<?php

class Reports extends FMIS_Controller {

	public function __construct() {
		parent::__construct();
        $this->load->database();
	}

	public function view()
	{

        $data = array(
    		'page_title' => 'Report'
    		//'message' => 'ThiS iS ReporT'
	    );
	    $this->setup_view('reports\view', $data);
	}

    public function statistical(){
        $this->load->model('Profile');
        $query = $this->Profile->get_graphData();
        $data = array(
            'page_title' => 'Statistical Report',
            'table' => $query,
            //'message' => 'ThiS iS ReporT'
        );
        $this->setup_view('reports\statistical', $data);
    }

    public function lists($list_type)
    {
        /*
         * the type of list is dependent
         * on the value of $list_type
         *
         * 0 -> faculty members per department list
         * 1 -> quarterly faculty researches per department
         * 2 -> quarterly faculty extension works per dept
         *
         *
         *
         * */
        if($list_type == 0)
        {
            $this->load->Model('Faculty_Profile_Model');
            $this->setup_view('reports/lists/list1', array(
                'page_title' => 'Faculty members per department',
                'cs_faculty' => $this->Faculty_Profile_Model->getByDepartment('Computer Science'),
                'it_faculty' => $this->Faculty_Profile_Model->getByDepartment('Information Technology')
            ));


        }
        else if($list_type == 1)
        {

        }
        else
        {

        }

    }

    public function generatereport()
    {
        //TODO: this will be the one managing the reports...
    }

    public function savereport()
    {
        //TODO: ano kay to? download report?
    }

}

/* End of file pages.php */
/* Location: ./application/controllers/pages.php */